import http from "@/api/axios";
import { BusinessType } from "@/api/moduleConfig";
export const getListApi = (data: AdditionalExpense.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/queryPage`,
    data
  });
};
export const getPageStaticApi = (data: AdditionalExpense.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/queryPageCount`,
    data
  });
};
// 审核
export const auditCostApi = (data: { ids: string[]; type: number }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/audit`,
    data
  });
};
// 添加费用
export const addFeeApi = (data: AdditionalExpense.AddFee) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/add`,
    data
  });
};

// 修改追加费用
export const modifyAddFeeApi = (data: AdditionalExpense.AddFee) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/edit`,
    data
  });
};

// 导入追加费用
export const importAddFeeApi = (data: FormData) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/importExcel`,
    data,
    headers: {
      "Content-type": "multipart/form-data"
    }
  });
};
// 删除费用
export const deleteFeeApi = (data: Array<string>) => {
  return http({
    method: "delete",
    url: `${BusinessType.finance}/biz/orderShipmentCost/deleteByIds`,
    data
  });
};

// 查看删除记录
export const getDeleteLogApi = (data: AdditionalExpense.DeleteLogSearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/getDeleteLog`,
    data
  });
};
// 统计
export const statisticsDataApi = (data: AdditionalExpense.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/addCostStatistics`,
    data
  });
};

// 导出
export const addCostExcelApi = (data: AdditionalExpense.SearchParams) => {
  return http({
    method: "post",
    url: `export/biz/exportExcel/addCostExcel`,
    data
  });
};

// 追加并审核
export const addAndPassApi = (data: AdditionalExpense.AddFee) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/orderShipmentCost/addAndPass`,
    data
  });
};
